<?php if(!defined('WDK_PATH')) exit('No direct script access allowed');
class WException extends Exception
{
	public function __toString()
	{
		$error = array();

		$debug = array_shift(self::getTrace());
		$args = "";
		if(empty($debug['args']) == false)
		{
			ob_start();
			print_r($debug['args']);
			$args = ob_get_contents();
			ob_end_clean();
		}

		array_push($error, "");
		array_push($error, "[FILE] ".$debug['file']);
		array_push($error, "[LINE] ".$debug['line']);
		array_push($error, "[CLASS] ".$debug['class']);
		array_push($error, "[FUNCTION] ".$debug['function']);
		array_push($error, "[ARGS] ". $args);
		array_push($error, "[MESSAGE] ".$this->getMessage());
		array_push($error, "");
		return implode("\n", $error);
	}
}
//	공통 Exceptions
class ControllerFileNotExistException extends WException {}	//	Class File 에러
class ClassFileNotExistException extends WException {}		//	Class File 에러
class MethodNotImplementedException extends WException {}	//	Class File 에러
class DatabaseConfigError extends WException {}				//	
class DatabaseConnectionError extends WException {}			//	
class DatabaseSqlException extends WException {}			//	SQL 에러
class NoRecordException extends WException {}				//	DB 레코드 에러
class DatabaseInsertException extends WException {}			//	DB 입력 에러
class DatabaseUpdateException extends WException {}			//	DB 수정 에러
class DatabaseDeleteException extends WException {}			//	DB 삭제 에러
class DatabaseDisableException extends WException {}		//	DB 삭제 에러
class DatabaseAffectedException extends WException {}		//	DB 변경 에러


//	비밀번호 관련 Exceptions
class PasswdLenthException extends WException {}	//


class PageNotFoundException extends WException {}